{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c6fe9df4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy\n",
    "import pandas"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6798bc6b",
   "metadata": {},
   "source": [
    "# Pandas重复值处理"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4754afba",
   "metadata": {},
   "source": [
    "- duplicated() 检测重复的行\n",
    "- drop_duplicates() 删除重复的行"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1255dab",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "703470e9",
   "metadata": {},
   "source": [
    "# Pandas数据映射"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "005a2fcf",
   "metadata": {},
   "source": [
    "- replace() 替换元素\n",
    "- map() 处理某一个单独的列，很重要！\n",
    "- rename() 替换索引\n",
    "- apply() 即支持Series，也支持DataFrame\n",
    "- transform()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c954b1c",
   "metadata": {},
   "source": [
    "- applymap() DataFrame专有的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9065dea4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# map() 一般用于Series数据结构，不能用于DataFrame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "899baaf5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# rename() 默认修改行索引，修改列索引需要加axis参数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1ac5680",
   "metadata": {},
   "source": [
    "- reset_index() 重置索引\n",
    "- set_index() 设置索引"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
